Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

138
Views
Why is the code not working? Neither client.on("ready") is working nor is client.on("messageCreate")

this is the code, from most sources that I have seen, this should work

this is the entire file

const Discord = require("discord.js")

const TOKEN = ""

const client = new Discord.Client({
    intents: [
        "GUILDS",
        "GUILD_MESSAGES"
    ]
})

client.on("ready", () => {
    console.log('Logged in as  ${client.user.tag}')
})

client.on("messageCreate", (message) => {
    if (message.content == "hi") {
        message.reply("Hello")
    }
})

client.login(TOKEN)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your intents are set incorrectly...

try this:

intents: [
    Discord.Intents.FLAGS.GUILDS,
    Discord.Intents.FALGS.GUILD_MESSAGES
]

About messageCreate:

If you need your bot to receive messages ( MESSAGE_CREATE - "messageCreate" in discord. js), you need the GUILD_MESSAGES intent. Done so like this: Discord.Intents.FALGS.GUILD_MESSAGES

More on Intent Privileges

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!